import request from '@/modules/index/utils/request';
import qs from "qs";

const store = {
    namespaced: true,
    state: {

    },
    mutations: {

    },
    actions: {
        // 帮助说明-列表
        // async helpInfoList(context, params) {
        //     const data = await request({
        //         url: params ? `/helpInfo/list?${params}` : '/helpInfo/list',
        //         method: 'get'
        //     });
        //     return data;
        // },

        // 菜单管理列表数据
        async initMenuList(context, params) {
            const data = await request({
                url: '/sys/menu/list',
                method: 'post',
                data: {}
            });
            return data;
        },
        // 菜单管理列表-删除
        async deleteMenuList(context, id) {
            const data = await request({
                url: `/sys/menu/delete/${id}`,
                method: 'get',
                data: {}
            });
            return data;
        },
        // 菜单管理列表-当行数据
        async getMenuRowDataById(context, id) {
            const data = await request({
                url: "/sys/menu/" + id,
                method: 'get',
                data: {}
            });
            return data;
        },
        // 菜单管理列表-新增
        async saveMenu(context, params) {
            const data = await request({
                url: "/sys/menu/save",
                method: 'post',
                data: params
            });
            return data;
        },

    }
};

export default store;
